/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ultrasoft.farmasoft.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Administrador
 */
@Embeddable
public class LocalityPK implements Serializable {
	private static final long serialVersionUID = 1L;
	@Basic(optional = false)
    @Column(name = "regionId")
    private int regionId;
    @Basic(optional = false)
    @Column(name = "localityId")
    private short localityId;

    public LocalityPK() {
    }

    public LocalityPK(int regionId, short localityId) {
        this.regionId = regionId;
        this.localityId = localityId;
    }

    public int getRegionId() {
        return regionId;
    }

    public void setRegionId(int regionId) {
        this.regionId = regionId;
    }

    public short getLocalityId() {
        return localityId;
    }

    public void setLocalityId(short localityId) {
        this.localityId = localityId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) regionId;
        hash += (int) localityId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LocalityPK)) {
            return false;
        }
        LocalityPK other = (LocalityPK) object;
        if (this.regionId != other.regionId) {
            return false;
        }
        if (this.localityId != other.localityId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ultrasoft.farmasoft.domain.LocalityPK[ regionId=" + regionId + ", localityId=" + localityId + " ]";
    }
    
}
